package base.thread;

public class A {

	public static synchronized void M2() {
		for(int i=0;i<100;i++) {
			try {
				Thread.sleep(10);
			} catch (InterruptedException e) {
				e.printStackTrace();
			}
			System.out.println("M2:"+i);
		}
	}
	
	public synchronized void M1() {
		for(int i=0;i<100;i++) {
			try {
				Thread.sleep(10);
			} catch (InterruptedException e) {
				e.printStackTrace();
			}
			System.out.println("M1:"+i);
		}
	}
	
}
